feat: migrate service account ot use 1Password sdk#137
Open
feat: migrate service account ot use 1Password sdk#137
Conversation
Migrate to use 1Password SDK with Service Account
Add secret ref validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates service account secret resolution in
load-secrets-actionfrom the CLI to the 1Password SDK. The action now selects the backend based on configuration:OP_SERVICE_ACCOUNT_TOKEN): resolve op://... references via the 1Password SDK. -> This is newChanges
@1password/sdkas a dependency.Secrets.validateSecretReference, failing with clearer errors when refs are invalid.Reviewed in these PRs: #135, #134
Tests:
To test these changes I created a branch with updates to the update the
dist/folders by runningnpm run build:allBranch is here: https://github.com/1Password/load-secrets-action/tree/jill/rebuild-dist
I then created an action in another repo which uses this branch to load secrets and opened a PR. You can see here that both jobs for Service account and Connect ran and were able to load the secrets.
The CLI was not installed for Service Account but was Installed for Connect.
I will wait until we handle to release PR to build the dist files from main once this is merged.